package com.videoshare.multimedia;

/*
 * Form per l'immissione dei metadati dei file multimediali. Utilizza il vocabolario Dublin Core
 */

import java.util.List;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.commons.logging.*;


public class MultimediaContentCreateForm extends ActionForm 
{
	// creator's data
	private String creatorFN = "";
	private String creatorFamily = "";
	private String creatorGiven = "";
	private String creatorTitle = "";
	private String creatorEmail = "";
	private String creatorPhoto = "";
	
	// lesson's data
	private String course = "";
	private String title = "";
	private String description = "";
	private String identifier = "";
	private String formatDimension = "";
	private String formatAudioStreamMimeType = "";
	private String formatBitRate = "";
	private String formatVideoStreamMimeType = "";
	private String formatDuration = "";
	private String publisher = "";
	private String date = "";
	
	private List resource = null;
	
	private String [] selectedResource = null;
	private int page = 0;
	
	public void reset(ActionMapping mapping, HttpServletRequest request)
	{
		// creator's data
		creatorFN = "";
		creatorFamily = "";
		creatorGiven = "";
		creatorTitle = "";
		creatorEmail = "";
		creatorPhoto = "";
		
		// lesson's data
		course = "";
		title = "";
		description = "";
		identifier = "";
		formatDimension = "";
		formatAudioStreamMimeType = "";
		formatBitRate = "";
		formatVideoStreamMimeType = "";
		formatDuration = "";
		publisher = "";
		date = "";
		
		resource = null;
		
		selectedResource = null;
		page = 0;
		
	}
	
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
	{
		ActionErrors errors = new ActionErrors();
		
		
		// creator's data
		if( (creatorFN == null) || creatorFN.trim().equals(""))
		{
			errors.add("creatorFN", new ActionMessage("multimedia.metadata.dc.creatorFN.problem"));
		}
		if( (creatorFamily == null) || creatorFamily.trim().equals(""))
		{
			errors.add("creatorFamily", new ActionMessage("multimedia.metadata.dc.creatorFamily.problem"));
		}
		if( (creatorGiven == null) || creatorGiven.trim().equals(""))
		{
			errors.add("creatorGiven", new ActionMessage("multimedia.metadata.dc.creatorGiven.problem"));
		}
		if( (creatorTitle == null) || creatorTitle.trim().equals(""))
		{
			errors.add("creatorTitle", new ActionMessage("multimedia.metadata.dc.creatorTitle.problem"));
		}
		if( (creatorEmail == null) || creatorEmail.trim().equals(""))
		{
			errors.add("creatorEmail", new ActionMessage("multimedia.metadata.dc.creatorEmail.problem"));
		}
		if( (creatorPhoto == null) || creatorPhoto.trim().equals(""))
		{
			errors.add("creatorPhoto", new ActionMessage("multimedia.metadata.dc.creatorPhoto.problem"));
		}
		
		// lesson's data
		if( (course == null) || course.trim().equals(""))
		{
			errors.add("course", new ActionMessage("multimedia.metadata.dc.relation.problem"));
		}
		if( (title == null) || title.trim().equals(""))
		{
			errors.add("title", new ActionMessage("multimedia.metadata.dc.title.problem"));
		}
		if( (identifier == null) || identifier.trim().equals(""))
		{
			errors.add("identifier", new ActionMessage("multimedia.metadata.dc.identifier.problem"));
		}
		if( (formatDimension == null) || formatDimension.trim().equals(""))
		{
			errors.add("formatDimension", new ActionMessage("multimedia.metadata.dc.formatDimension.problem"));
		}
		if( (formatAudioStreamMimeType == null) || formatAudioStreamMimeType.trim().equals(""))
		{
			errors.add("formatAudioStreamMimeType", new ActionMessage("multimedia.metadata.dc.formatAudioStreamMimeType.problem"));
		}
		if( (formatBitRate == null) || formatBitRate.trim().equals(""))
		{
			errors.add("formatBitRate", new ActionMessage("multimedia.metadata.dc.formatBitRate.problem"));
		}
		if( (formatVideoStreamMimeType == null) || formatVideoStreamMimeType.trim().equals(""))
		{
			errors.add("formatVideoStreamMimeType", new ActionMessage("multimedia.metadata.dc.formatVideoStreamMimeType.problem"));
		}
		if( (formatDuration == null) || formatDuration.trim().equals(""))
		{
			errors.add("formatDuration", new ActionMessage("multimedia.metadata.dc.formatDuration.problem"));
		}
		
		
		
		return errors;
	}

	/**
	 * @return Returns the course.
	 */
	public String getCourse() {
		return course;
	}

	/**
	 * @param course The course to set.
	 */
	public void setCourse(String course) {
		this.course = course;
	}

	

	/**
	 * @return Returns the date.
	 */
	public String getDate() {
		return date;
	}

	/**
	 * @param date The date to set.
	 */
	public void setDate(String date) {
		this.date = date;
	}

	/**
	 * @return Returns the description.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description The description to set.
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	

	/**
	 * @return Returns the identifier.
	 */
	public String getIdentifier() {
		return identifier;
	}

	/**
	 * @param identifier The identifier to set.
	 */
	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	/**
	 * @return Returns the publisher.
	 */
	public String getPublisher() {
		return publisher;
	}

	/**
	 * @param publisher The publisher to set.
	 */
	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	/**
	 * @return Returns the title.
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title The title to set.
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return Returns the creatorEmail.
	 */
	public String getCreatorEmail() {
		return creatorEmail;
	}

	/**
	 * @param creatorEmail The creatorEmail to set.
	 */
	public void setCreatorEmail(String creatorEmail) {
		this.creatorEmail = creatorEmail;
	}

	/**
	 * @return Returns the creatorFamily.
	 */
	public String getCreatorFamily() {
		return creatorFamily;
	}

	/**
	 * @param creatorFamily The creatorFamily to set.
	 */
	public void setCreatorFamily(String creatorFamily) {
		this.creatorFamily = creatorFamily;
	}

	/**
	 * @return Returns the creatorFN.
	 */
	public String getCreatorFN() {
		return creatorFN;
	}

	/**
	 * @param creatorFN The creatorFN to set.
	 */
	public void setCreatorFN(String creatorFN) {
		this.creatorFN = creatorFN;
	}

	/**
	 * @return Returns the creatorGiven.
	 */
	public String getCreatorGiven() {
		return creatorGiven;
	}

	/**
	 * @param creatorGiven The creatorGiven to set.
	 */
	public void setCreatorGiven(String creatorGiven) {
		this.creatorGiven = creatorGiven;
	}

	/**
	 * @return Returns the creatorTitle.
	 */
	public String getCreatorTitle() {
		return creatorTitle;
	}

	/**
	 * @param creatorTitle The creatorTitle to set.
	 */
	public void setCreatorTitle(String creatorTitle) {
		this.creatorTitle = creatorTitle;
	}

	/**
	 * @return Returns the formatAudioStreamMimeType.
	 */
	public String getFormatAudioStreamMimeType() {
		return formatAudioStreamMimeType;
	}

	/**
	 * @param formatAudioStreamMimeType The formatAudioStreamMimeType to set.
	 */
	public void setFormatAudioStreamMimeType(String formatAudioStreamMimeType) {
		this.formatAudioStreamMimeType = formatAudioStreamMimeType;
	}

	/**
	 * @return Returns the formatBitRate.
	 */
	public String getFormatBitRate() {
		return formatBitRate;
	}

	/**
	 * @param formatBitRate The formatBitRate to set.
	 */
	public void setFormatBitRate(String formatBitRate) {
		this.formatBitRate = formatBitRate;
	}

	/**
	 * @return Returns the formatDimension.
	 */
	public String getFormatDimension() {
		return formatDimension;
	}

	/**
	 * @param formatDimension The formatDimension to set.
	 */
	public void setFormatDimension(String formatDimension) {
		this.formatDimension = formatDimension;
	}

	/**
	 * @return Returns the formatDuration.
	 */
	public String getFormatDuration() {
		return formatDuration;
	}

	/**
	 * @param formatDuration The formatDuration to set.
	 */
	public void setFormatDuration(String formatDuration) {
		this.formatDuration = formatDuration;
	}

	/**
	 * @return Returns the formatVideoStreamMimeType.
	 */
	public String getFormatVideoStreamMimeType() {
		return formatVideoStreamMimeType;
	}

	/**
	 * @param formatVideoStreamMimeType The formatVideoStreamMimeType to set.
	 */
	public void setFormatVideoStreamMimeType(String formatVideoStreamMimeType) {
		this.formatVideoStreamMimeType = formatVideoStreamMimeType;
	}

	/**
	 * @return Returns the creatorPhoto.
	 */
	public String getCreatorPhoto() {
		return creatorPhoto;
	}

	/**
	 * @param creatorPhoto The creatorPhoto to set.
	 */
	public void setCreatorPhoto(String creatorPhoto) {
		this.creatorPhoto = creatorPhoto;
	}

	/**
	 * @return Returns the selectedResource.
	 */
	public String[] getSelectedResource() {
		return selectedResource;
	}

	/**
	 * @param selectedResource The selectedResource to set.
	 */
	public void setSelectedResource(String[] selectedResource) {
		this.selectedResource = selectedResource;
	}

	/**
	 * @return Returns the page.
	 */
	public int getPage() {
		return page;
	}

	/**
	 * @param page The page to set.
	 */
	public void setPage(int page) {
		this.page = page;
	}

	/**
	 * @return Returns the resource.
	 */
	public List getResource() {
		return resource;
	}

	/**
	 * @param resource The resource to set.
	 */
	public void setResource(List resource) {
		this.resource = resource;
	}
}
